#include "stl.h"
#include "solution.h"

int main(int argc, char *argv[]){
    struct {
        vector<vector<string>> equations;
        vector<double> values;
        vector<vector<string>> queries;
    } tests[] = {
        {
            {{"a","b"},{"b","c"}},
            {2.0,3.0},
            {{"a","c"},{"b","a"},{"a","e"},{"a","a"},{"x","x"}},
        },  // [6.00000,0.50000,-1.00000,1.00000,-1.00000]
        {
            {{"a","b"},{"b","c"},{"bc","cd"}},
            {1.5,2.5,5.0},
            {{"a","c"},{"c","b"},{"bc","cd"},{"cd","bc"}},
        },  // [3.75000,0.40000,5.00000,0.20000]
        {
            {{"a","b"}},
            {0.5},
            {{"a","b"},{"b","a"},{"a","c"},{"x","y"}},
        },  // [0.50000,2.00000,-1.00000,-1.00000]
        {
            {{"a","b"},{"e","f"},{"b","e"}},
            {3.4,1.4,2.3},
            {{"b","a"},{"a","f"},{"f","f"},{"e","e"},{"c","c"},{"a","c"},{"f","e"}},
        },  // [0.29412,10.948,1.0,1.0,-1.0,-1.0,0.71429]
    };
    int i = 0;
    for(auto & ts : tests){
        print("\n[", ++i,"] equations=", ts.equations, "\n")
        print("values=", ts.values, "\n")
        print("queries=", ts.queries, "\n")
        Solution sln;
        auto res = sln.calcEquation(ts.equations, ts.values, ts.queries);
        print("res=", res, "\n")
    }
    
    print("\n------ main exit ------\n")
    return 0;
}
